Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#64) Support tasks retry & propagate raised exception #65

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

imranariffin
Copy link
Owner

@imranariffin imranariffin commented Nov 27, 2023

(#64) Support tasks retry & propagate raised exception

For documentation, see:

  1. Docstring of task.task (which will point to interfaces.TaskOptions and in turn interfaces.RetryOptions)
  2. Tests in tests.test_task e.g. test_retry_as_per_task_definition
  3. Sample usages in tests.apps.simple_app e.g. append_to_file

Changelist:

  • Formalize serialization and deserialization
  • Serialize & deserialize exceptions correctly
  • Encapsulate retry & retry_on in a new dict 'options'
  • Implement serde for AsyncResult
  • Ensure generated file deleted after test
  • Add jsonpickle to toml file
  • Exclude if TYPE_CHECKING: from coverage
  • Add test for singleton
  • Add logging for worker
  • Wrap all constants inside Config class
  • Split the file constants.py into constants.py and config.py (cc @cglotr)
  • Refactor AsyncResult to be a simple class with no async-await, and remove unused attributes (cc @cglotr)
  • Avoid retrying forever (cc @cglotr)
  • Handle case with options.retry.on is empty

@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2023

Codecov Report

Attention: Patch coverage is 99.76359% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 99.59%. Comparing base (f02f6ce) to head (5bd0afa).

Files Patch % Lines
src/aiotaskq/task.py 98.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #65      +/-   ##
==========================================
+ Coverage   99.21%   99.59%   +0.38%     
==========================================
  Files          18       21       +3     
  Lines         635      988     +353     
==========================================
+ Hits          630      984     +354     
+ Misses          5        4       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@imranariffin imranariffin changed the title 64/support retry on tasks (#64) Support tasks retry & propagate raised exception Dec 3, 2023
@imranariffin imranariffin marked this pull request as ready for review December 3, 2023 04:37
@imranariffin imranariffin force-pushed the 64/support-retry-on-tasks branch 2 times, most recently from d09a7eb to 8a2e01a Compare December 3, 2023 05:32
For documentation, see:
1. Docstring of `task.task`
2. Tests in `tests.test_task` e.g. `test_retry_as_per_task_definition`
3. Sample usages in `tests.apps.simple_app` e.g. `append_to_file`

Changelist:

* Formalize serialization and deserialization
* Serialize & deserialize exceptions correctly
* Encapsulate retry & retry_on in a new dict 'options'
* Implement serde for AsyncResult
* Ensure generated file deleted after test
* Add jsonpickle to toml file
* Exclude `if TYPE_CHECKING:` from coverage
* Add test for singleton
* Add logging for worker
* Wrap all constants inside `Config` class

Signed-off-by: Imran Ariffin <[email protected]>
src/aiotaskq/constants.py Show resolved Hide resolved
src/aiotaskq/constants.py Show resolved Hide resolved
src/aiotaskq/task.py Outdated Show resolved Hide resolved
src/aiotaskq/task.py Outdated Show resolved Hide resolved
src/aiotaskq/worker.py Show resolved Hide resolved
src/aiotaskq/worker.py Outdated Show resolved Hide resolved
@imranariffin imranariffin requested a review from cglotr July 28, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants